From 42a0b4998b3b1b7aee0cecd628de5d9bfb974039 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 1 Feb 2006 00:56:19 +0100 Subject: [PATCH] The memset in init_switch_stack is overwriting the processor stack. We need to avoid manipulating the switch stack area of the currently running cpu. Original patch by Kevin Tian. Signed-off-by: Alex Williamson --- xen/arch/ia64/xen/domain.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xen/arch/ia64/xen/domain.c b/xen/arch/ia64/xen/domain.c index a331141976..379e47812f 100644 --- a/xen/arch/ia64/xen/domain.c +++ b/xen/arch/ia64/xen/domain.c @@ -157,14 +157,14 @@ struct vcpu *alloc_vcpu_struct(struct domain *d, unsigned int vcpu_id) if ((v = alloc_xenheap_pages(KERNEL_STACK_SIZE_ORDER)) == NULL) return NULL; memset(v, 0, sizeof(*v)); - } - ti = alloc_thread_info(v); - /* Clear thread_info to clear some important fields, like - * preempt_count - */ - memset(ti, 0, sizeof(struct thread_info)); - init_switch_stack(v); + ti = alloc_thread_info(v); + /* Clear thread_info to clear some important fields, like + * preempt_count + */ + memset(ti, 0, sizeof(struct thread_info)); + init_switch_stack(v); + } if (!is_idle_domain(d)) { v->arch.privregs = -- 2.30.2